<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<head>
	<title>Aluno Graduação [listagem]</title>
</head>
<body>
	<jsp:include page="/WEB-INF/jsp/menu.jsp"></jsp:include>
	<h1>Listagem de Alunos de Graduação</h1>

	<table>
		<tr>
			<th>Nome</th>
			<th>Email</th>
			<th>Data ingresso</th>
			<th>Orientador</th>			
			<th></th>
			<c:if test="${ sessaoUsuario.logado }">
				<th></th>
				<th></th>
			</c:if>
		</tr>

		<c:forEach items="${alunoGraduacaoList}" var="alunoGraduacao">
			<tr>
				<td>${alunoGraduacao.nome}</td>
				<td>${alunoGraduacao.email}</td>
				<td>${alunoGraduacao.dataIngressoStr}</td>
				<td>${alunoGraduacao.orientador}</td>
				<td><a href="${pageContext.request.contextPath}/alunosGraduacao/${alunoGraduacao.id}">mostrar</a></td>
				<c:if test="${ sessaoUsuario.logado }">
					<td><a href="${pageContext.request.contextPath}/alunosGraduacao/${alunoGraduacao.id}/edit">editar</a></td>
					<td>
						<form action="${pageContext.request.contextPath}/alunosGraduacao/${alunoGraduacao.id}" method="post">
							<input type="hidden" name="_method" value="delete"/>
							<button type="submit" onclick="return confirm('Tem certeza?')">excluir</button>
						</form>
					</td>
				</c:if>
			</tr>
		</c:forEach>
	</table>

	<br />
	<c:if test="${ sessaoUsuario.logado }">
		<a href="${pageContext.request.contextPath}/alunosGraduacao/new">Novo Aluno Graduação</a> 
	</c:if>
</body>